#include <QtGui>

#include "qhexedit.h"
QHexEdit::QHexEdit(QWidget *parent , const ShowableItem *items) : QScrollArea(parent)
{
    qHexEdit_p = new QHexEditPrivate(this, items);
    setWidget(qHexEdit_p);
    setWidgetResizable(true);

	connect(qHexEdit_p, SIGNAL(mouseClicked(const int, const int)), this, SIGNAL(mouseClicked(const int, const int)));
}

void QHexEdit::setSelection(int begin, int end) const
{
	int pos = qHexEdit_p->setSelection(begin, end);
	
	verticalScrollBar()->setRange(0, pos);
}